<template>
  <div>
    <el-table
        :data="tableData"
        border
        style="width: 100%">
      <el-table-column

          prop="oderNo"
          label="交易号"
          width="150">
      </el-table-column>
      <el-table-column
          prop="applyNo"
          label="订单号"
          width="120">
      </el-table-column>
      <el-table-column
          prop="email"
          label="邮箱"
          width="120">
      </el-table-column>
      <el-table-column
          prop="money"
          label="金钱"
          width="120">
      </el-table-column>

      <el-table-column
          prop="msg"
          label="支付情况"
          width="120">
      </el-table-column>
      <el-table-column
          prop="status"
          label="支付状态"
          width="120">
      </el-table-column>
      <el-table-column
          prop="startTime"
          label="支付时间"
          width="120">
      </el-table-column>
      <el-table-column
          prop="name"
          label="名称"
          width="120">
      </el-table-column>
      <el-table-column
          fixed="right"
          label="操作"
          width="100">
        <template slot-scope="scope">
          <el-button v-if="scope.row.status==0"  @click="topay(scope.row.id)" type="text" size="small">支付</el-button>
          <el-button v-if="scope.row.status==1"   type="text" size="small">已支付</el-button>
          <el-button v-if="scope.row.status==2"   type="text" size="small">出现异常</el-button>

        </template>
      </el-table-column>




    </el-table>
  </div>
</template>

<script>
export default {
  name: "OderView",
  data() {
    return {
      tableData:[]
    }
  }, methods: {
    list(){
      this.axios.post("olist").then(res=>{

        this.tableData=res.data;


      })
    },
    topay(id){
      this.axios.post("toPay?id="+id).then(res=>{

        document.writeln(res.data);


      })
    },

  }, created() {
     this.list();
  }
}
</script>

<style scoped>

</style>